﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using System.Data;
using FusionDotNet; 

namespace FusionDotNet.WorkflowActivities
{

    public sealed class SelectActivity : FusionActivityBase<DataTable, SelectResult>
    {
        [RequiredArgument]
        public InArgument<string> Query { get; set; }

        public override Command<SelectResult> CreateCommand(AsyncCodeActivityContext context)
        {
            return new SelectCommand(context.GetValue(Query));
        }

        public override DataTable CreateResult(SelectResult commandResult)
        {
            return commandResult.ResultTable;
        }
    }
}
